home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / manageme / snmp-dev.000 / snmp-dev / acl.h next >
Encoding:
C/C++ Source or Header  |  1995-07-19  |  1.9 KB  |  86 lines

  1. /*
  2.   aclTarget        INTEGER,
  3.   aclSubject       INTEGER,
  4.   aclResources     INTEGER,
  5.   aclPrivileges    INTEGER,
  6.   aclStorageType   StorageType,
  7.   aclStatus        RowStatus
  8.  */
  9.  
  10. #define ACLTARGET    1
  11. #define ACLSUBJECT    2
  12. #define ACLRESOURCES    3
  13. #define ACLPRIVELEGES    4
  14. #define ACLSTORAGETYPE    5
  15. #define ACLSTATUS    6
  16.  
  17. #define ACLNONEXISTENT        0
  18. #define ACLACTIVE             1
  19. #define ACLNOTINSERVICE       2
  20. #define ACLNOTREADY           3
  21. #define ACLCREATEANDGO        4
  22. #define ACLCREATEANDWAIT      5
  23. #define ACLDESTROY            6
  24.  
  25. #define ACLPRIVELEGESGET        1
  26. #define ACLPRIVELEGESGETNEXT        2
  27. #define ACLPRIVELEGESGETRESPONSE    4
  28. #define ACLPRIVELEGESSET        8
  29. #define ACLPRIVELEGESBULK        32
  30. #define ACLPRIVELEGESINFORM        64
  31. #define ACLPRIVELEGESTRAP2        128
  32.  
  33. struct aclEntry {
  34.     int        aclTarget;
  35.     int        aclSubject;
  36.     int        aclResources;
  37.     int        aclPriveleges;
  38.     int        aclStorageType;
  39.     int        aclStatus;
  40.     
  41.     u_long    aclBitMask;
  42.  
  43.     struct aclEntry *reserved;
  44.     struct aclEntry *next;
  45. };
  46.  
  47. u_char *var_acl();
  48. int write_acl();
  49.  
  50. struct aclEntry *
  51. acl_getEntry(/* int target, int subject, int resources */);
  52. /*
  53.  * Returns a pointer to the aclEntry with the
  54.  * same target and subject and resources.
  55.  * Returns NULL if that entry does not exist.
  56.  */
  57.  
  58. void acl_scanInit();
  59. /*
  60.  * Initialized the scan routines so that they will begin at the
  61.  * beginning of the list of aclEntries.
  62.  *
  63.  */
  64.  
  65.  
  66. struct aclEntry *
  67. acl_scanNext();
  68. /*
  69.  * Returns a pointer to the next aclEntry.
  70.  * These entries are returned in no particular order,
  71.  * but if N entries exist, N calls to acl_scanNext() will
  72.  * return all N entries once.
  73.  * Returns NULL if all entries have been returned.
  74.  * acl_scanInit() starts the scan over.
  75.  */
  76.  
  77. struct aclEntry *
  78. acl_createEntry(/* int target, int subject, int resources */);
  79. /*
  80.  * Creates a aclEntry with the given index
  81.  * and returns a pointer to it.
  82.  * The status of this entry is created as invalid.
  83.  */
  84.  
  85. extern void acl_destroyEntry ();
  86.